package com.cy.pj.sys.common.config;

import com.cy.pj.sys.common.web.TimeAccessInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 张琪
 * @date 2020/11/21
 * @describe
 */
@Configuration
public class SpringWebConfig implements WebMvcConfigurer {
//    将设置的准入规则添加到拦截器中
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new TimeAccessInterceptor())
                .addPathPatterns("/user/doLogin");
    }
}
